package sxe.core.image;

import snobject.*;
import step.FunctionWrapper;
import step.EvaluationFailure;
import java.io.IOException;

public class saveSNImage extends FunctionWrapper {
	public snObject Call(snObjectArgList argv) throws EvaluationFailure {
		snImage sni = argv.popImage();
		snString filename = argv.popString();
		
		try {
			ImageProcessing.saveSNImage(sni,filename.getString());
			return filename;
		} catch (IOException i) {
			System.err.println(i.getMessage());
			return new snBoolean(false);
		}
	}
}